package com.chen.recruit.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.chen.recruit.common.constants.SysConstants;
import com.chen.recruit.common.enums.CommonStatus;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 岗位对象 t_post
 *
 * @author cgy
 * @date 2022-08-17
 */
@Data
@ApiModel("Post 岗位持久化对象")
@EqualsAndHashCode(callSuper = true)
public class Post extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 岗位ID
     */
    @ApiModelProperty("岗位ID")
    @Null(message = "新增岗位id必须为空",groups = AddGroup.class)
    @NotNull(message = "更新岗位id不能为空", groups = UpdateGroup.class)
    private Integer id;

    /**
     * 岗位名称
     */
    @ApiModelProperty("岗位名称")
    @Excel(name = "岗位名称", width = 20)
    @NotBlank(message = "岗位名称不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private String name;

    /**
     * 状态（1启用 0禁用）
     */
    @ApiModelProperty("状态（1启用 0禁用）")
    @Excel(name = "岗位状态", width = 20, enumExportField = SysConstants.ENUM_EXPORT_FIELD)
    @NotNull(message = "岗位状态不能为空",groups = UpdateGroup.class)
    private CommonStatus status;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    @Excel(name = "岗位备注", width = 20)
    private String remark;

}
